<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
	<title>房源购，欢迎登录</title>

    <link rel="stylesheet" type="text/css" href="css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="css/pages-login.css" />
</head>

<body>
	<div class="login-box" id="app">
		<!--head-->
		<div class="py-container logoArea">
			<a href="" class="logo"></a>
		</div>
		<!--loginArea-->
		<div class="loginArea">
			<div class="py-container login">
				<div class="loginform">
					<ul class="sui-nav nav-tabs tab-wraped">
						<li>
							<a href="#index" data-toggle="tab">
								<h3>扫描登录</h3>
							</a>
						</li>
						<li class="active">
							<a href="#profile" data-toggle="tab">
								<h3>账户登录</h3>
							</a>
						</li>
					</ul>
					<div class="tab-content tab-wraped">
						<div id="index" class="tab-pane">
							<p>二维码登录，暂为官网二维码</p>
							<img src="img/wx_cz.jpg" />
						</div>
						<div id="profile" class="tab-pane  active">
							<form class="sui-form">
								<div class="input-prepend"><span class="add-on loginname"></span>
									<input v-model="goods.loginName" type="text" placeholder="请输入用户名" class="span2 input-xfat">
								</div>
								<div class="input-prepend"><span class="add-on loginpwd"></span>
									<input v-model="goods.loginPwd" type="password" placeholder="请输入密码" class="span2 input-xfat">
								</div>
								<div class="setting">
									<label class="checkbox inline">
          <input name="m1" type="checkbox" value="2" checked="">
          自动登录
        </label>
									<span class="forget">忘记密码？</span>
								</div>
								<div class="logined">
									<input type="button" value="登录" @click="login()" class="sui-btn btn-block btn-xlarge btn-danger" />
								</div>
							</form>

						</div>
					</div>
				</div>
			</div>
		</div>
		<!--foot-->
		<div class="py-container copyright">
			<ul>
				<li>关于我们</li>
				<li>联系我们</li>
				<li>联系客服</li>
			</ul>
			<div class="address">地址：北京市昌平区建材城西路金燕龙办公楼一层 邮编：100096 电话：400-618-4000 传真：010-82935100</div>
			<div class="beian">京ICP备08001421号京公网安备110108007702
			</div>
		</div>
	</div>


</body>
<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="js/pages/login.js"></script>
<script src="../static/vue.js"></script>
<script src="../static/axios.min.js"></script>
<script src="../static/moment.js"></script>
<script type="text/javascript" src="js/md5.js"></script>
<script>

	var v=new Vue({
		el:"#app",//具体那个视图
		data:{//数据属性
			goods:{
				loginName:'',
				loginPwd:''
			},

		},
		methods: {//函数
			login:function () {
				if(this.goods.loginName==null ||this.goods.loginPwd==null){
					alert("请输入用户名或密码");
					return;
				}
				debugger;
				this.goods.loginPwd=hex_md5(this.goods.loginPwd);
<<<<<<< HEAD
				debugger
=======
>>>>>>> 9c94696385770f5f4f82ce1a529b6d48167ca2c5
				axios.post("/api/house-user/user/login",this.goods).then((res)=>{
					if(res.data.success){
						debugger
						alert(res.data.message);
						window.sessionStorage.setItem("user",JSON.stringify(res.data.result.user));
						window.sessionStorage.setItem("token",res.data.result.token);
						window.location.href="seckill-index.html";
					}else{
						alert(res.data.message);
					}

				});
			}

		}


	});

</script>

</html>
